<template>
  <div class="stats-page">
    <h2>{{ resultText }}</h2>
    <button class="back-button" @click="goBack">返回主页</button>
  </div>
</template>

<script>
import { computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'

export default {
  setup() {
    const router = useRouter()
    const route = useRoute()
    
    const resultText = computed(() => {
      return route.query.result || '统计结果页面'
    })
    
    const goBack = () => {
      router.push({ name: 'Home' })
    }
    
    return {
      resultText,
      goBack
    }
  }
}
</script>

<style scoped>
.stats-page {
  text-align: center;
  padding: 40px;
}

.stats-page h2 {
  font-size: 26px;
  margin-bottom: 30px;
  color: #2c3e50;
}
</style>